<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\ProjectUrl
 *
 * @property integer $id
 * @property integer $project_id
 * @property string $url_type
 * @property string $url_name
 * @property string $deleted_at
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \App\Project $toProject
 * @method static \Illuminate\Database\Query\Builder|\App\ProjectUrl whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\ProjectUrl whereProjectId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\ProjectUrl whereUrlType($value)
 * @method static \Illuminate\Database\Query\Builder|\App\ProjectUrl whereUrlName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\ProjectUrl whereDeletedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\ProjectUrl whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\ProjectUrl whereUpdatedAt($value)
 * @property-read \App\ProjectUrl $orgUrl
 */
class ProjectUrl extends Model {

	//表名
    protected $table = 'project_url';
    protected $fillable = ['url_type','url_name','project_id'];
    use SoftDeletes;

    /** 关联项目表 */
    public function toProject()
    {
        return $this->belongsTo('App\Project' , 'project_id') ;
    }

    public function orgUrl()
    {
        return $this->hasOne('App\ProjectUrl' , 'link_web_id');
    }

}
